package com.jp.knowledge.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;

import com.jp.knowledge.R;
import com.jp.knowledge.adapter.team_circle.TeamCircleConstactsAdapter;
import com.jp.knowledge.model.TeamCircleConstactsModel;
import com.jp.knowledge.my.base.RecycleVHolder;

import java.util.List;

/**
 * Created by 528787067@qq.com on 2017/4/13.
 */

public class CompanyContactsAdapter extends TeamCircleConstactsAdapter {
    public CompanyContactsAdapter(Context context, @NonNull List<TeamCircleConstactsModel> list) {
        super(context, list);
    }

    @Override
    public void onBind(RecycleVHolder holder, int position) {
        super.onBind(holder, position);
        String managerText = "";
        if(getData(position).getCompanyAdmin() == 1)
            managerText += "超级管理员";
        else if(getData(position).getCompanyManage() == 1)
            managerText += "管理员";
        String detailText = (String) holder.getTextView(R.id.team_circle_contacts_detail).getText();
        if(detailText.trim().length() > 0 && managerText.trim().length() > 0)
            detailText += "-";
        detailText += managerText;
        setTextView(holder.getTextView(R.id.team_circle_contacts_detail), detailText);
        // 不显示电话号码
        holder.get(R.id.phone).setVisibility(View.GONE);
    }
}
